#include <bits/stdc++.h>
using namespace std;

bool eqa(const string &a, const string &b){
    for (int i = 0; i < a.size(); ++i) {
        if(a[i] != b[i]) return false;
    }
    return true;
}


int main() {
    string s;
    while (cin >> s){
        string y = s; reverse(y.begin(), y.end());
        int ans = 0;
        for (int p = s.size()-1; p >=0 ; --p) {
            string subs = s.substr(p);
            int l = subs.size();
            if(eqa(subs, y.substr(0, l))) ans = p;
        }
        string ad = s.substr(0, ans);
        reverse(ad.begin(), ad.end());
        cout << s+ad << "\n";
    }
    return 0;
}
